package com.example.template.service.comand;

import com.example.template.utils.ApplicationContextHolder;
import com.example.template.utils.Command;

public class DeleteStudentCommand implements Command {

    private final Receiver receiver;

    public DeleteStudentCommand() {
        this.receiver = ApplicationContextHolder.getApplicationContext()
                .getBean(Receiver.class);
    }

    @Override
    public void execute() {
        receiver.action(this);
    }

    public static interface Receiver {
        void action(DeleteStudentCommand command);
    }
}
